<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./../../WEB-INF/templates/noBarNoFooterTemplate.xhtml">

            <ui:define name="content">
                <h:form id="recoverForm">
                    <p:growl id="growl"></p:growl>
                    <f:metadata>
                        <f:viewParam for="hola" required="true" requiredMessage="#{messages.Recharge}" name="id" value="#{recoveryPasswordBean.recoverId}"></f:viewParam>
                    </f:metadata>
                    <h:outputText id="hola"></h:outputText>
                    <p:panel styleClass="noBorder center" header="#{messages.Recover}">
                        <p:panelGrid columns="1" styleClass="noBorder inlineBlock">
                            <p:inputText id="recoveryEmail" value="#{recoveryPasswordBean.email}">
                                <f:validator  binding="#{loginEmailValidator}"></f:validator>
                            </p:inputText>
                            <p:watermark for="recoveryEmail" value="#{messages.Email}" />
                            <p:password styleClass="ui-inputtext" id="password" match="password2" feedback="true" value="#{recoveryPasswordBean.newPassword}" required="true" requiredMessage="#{messages.PasswordRequired}" label="#{messages.Password}">
                                <f:validateLength minimum="5" maximum="30"></f:validateLength>
                            </p:password>
                            <p:watermark for="password" value="#{messages.Password}" />

                            <p:password styleClass="ui-inputtext" id="password2" feedback="true" value="#{recoveryPasswordBean.newPassword}" required="true" requiredMessage="#{messages.RepeatPasswordRequired}" label="#{messages.RepeatPassword}">
                            </p:password>
                            <p:watermark for="password2" value="#{messages.RepeatPassword}" />
                            
                            <p:commandButton update="growl" value="#{messages.Recover}"  action="#{recoveryPasswordBean.changePassword()}"></p:commandButton>
                        </p:panelGrid>
                        
                    </p:panel>
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
